package demo.dubbo.config;

import org.springframework.context.annotation.Bean;

import com.alibaba.dubbo.config.spring.ServiceBean;

import demo.design.patterns.structural.FacadeDemo;

/**
 * Dubbo生产者配置
 *
 */
// @Configuration
public class ProviderConfig extends DubboBaseConfig {

    @Bean
    public ServiceBean<FacadeDemo> personServiceExport(FacadeDemo person) {
        ServiceBean<FacadeDemo> serviceBean = new ServiceBean<>();
        serviceBean.setProxy("javassist");
        serviceBean.setVersion("myversion");
        serviceBean.setInterface(FacadeDemo.class.getName());
        serviceBean.setRef(person);
        serviceBean.setTimeout(5000);
        serviceBean.setRetries(3);
        return serviceBean;
    }
}
